# -*- coding:utf-8 -*-
# @Author: shenyuyu
# @Time: 2023/6/12 15:00
# @File: qu_4.py

"""
有一对幼兔，幼兔1个月后长成小兔，小兔1个月后长成成兔并生下一对幼兔，问8个月后有多少对兔
子，幼兔、小兔、成兔对数分别是多少。
1---2
2---2
3---2 2
4---2 2 2
5---2 2---2 2 2
"""

sum1 = 1
sum2 = 0
sum3 = 0
month = 1
while month <= 8:
    if month == 1:
        sum1 = 0
        sum2 = 1
        sum3 = 0
    elif month > 1:
        sum3 = sum2 + sum3
        sum2 = sum1
        sum1 = sum3
    month = month + 1
print(sum1 + sum2 + sum3)
